module('filePath',package.seeall)
require "Cocos2d"
local version="1.0.0.2"--版本号
local pathToSave =nil
url="http://git.oschina.net/bobomxc/xmd_update/raw/master/oss_ios_1.0.0.2/"--版本资源地址
pathToSave = cc.FileUtils:getInstance():getWritablePath()--写入路径
cclog("pathToSave--->%s",pathToSave)
_paths={--搜索路径
    pathToSave.."filePath",--基础类库
    pathToSave.."gameScene",
    pathToSave.."lead_guide",
    pathToSave.."read",
    pathToSave.."util",
    pathToSave.."localData",
    pathToSave.."mv",
    pathToSave.."v1002game_1_2_1_1",
    pathToSave.."v1002game_1_2_1_1/game_1_2_1_1",
    pathToSave.."v1002game_1_2_1_1/music",
    pathToSave.."v1002game_1_2_1_1/publish",
    pathToSave.."v1002game_1_2_1_2",
    pathToSave.."v1002game_1_2_1_2/game_1_2_1_2",
    pathToSave.."v1002game_1_2_1_2/music",
    pathToSave.."v1002game_1_2_1_2/publish",
    pathToSave.."v1002game_1_2_1_3",
    pathToSave.."v1002game_1_2_1_3/game_1_2_1_3",
    pathToSave.."v1002game_1_2_1_3/music",
    pathToSave.."v1002game_1_2_1_3/publish",
    pathToSave.."XueShi_MainMap",
    pathToSave.."XueShi_MainMap/XusShi_MainMap",
    pathToSave.."XueShi_MainMap/publish"
}--搜索路径
_updateList={--更新别表
{name="filePath.zip",version="filePathversion"},
{name="gameScene.zip",version="gameScene_version"},
{name="lead_guide.zip",version="lead_guide_version"},
{name="read.zip",version="read_version"},
{name="util.zip",version="util_version"},
{name="localData.zip",version="localData_version"},
{name="mv.zip",version="mv_version"},
{name="v1002game_1_2_1_1.zip",version="v1002game_1_2_1_1_version"},
{name="v1002game_1_2_1_2.zip",version="v1002game_1_2_1_2_version"},
{name="v1002game_1_2_1_3.zip",version="v1002game_1_2_1_3_version"},
{name="XueShi_MainMap.zip",version="XueShi_MainMap_version"}
}
local function change_version()--更新客户端版本号
	-- body
	cc.UserDefault:getInstance():setStringForKey("client_version", "1.0.0.2")
    cc.UserDefault:getInstance():flush()
end
function addSearchPaths()--添加搜索路径
    cclog(""..#_paths)
    for k,v in ipairs(_paths) do
        cc.FileUtils:getInstance():addSearchPath(v,true)
        cclog(""..v)
    end
    change_version()
end
function getVersion(  )
    -- body
    return version
end
cclog("filePath--->version->1.0.0.2")
